<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" import="com.zzty.taskapp.entity.*"
	import="java.io.*"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ZZTY</title>
<!-- BOOTSTRAP STYLES-->
<link href="../css/bootstrap.css" rel="stylesheet" />

<!-- CUSTOM STYLES-->
<link href="../css/custom.css" rel="stylesheet" />
<script type="text/javascript" src="../js/AjaxAPI.js" charset="UTF-8"></script>

<script type="text/javascript">

	function refresh() {
		var date1 = document.getElementById("targetdate").value;
		<!-- 当前时间-->
		var day2 = new Date();
		day2.setTime(day2.getTime());
		var month = day2.getMonth();
		var date = day2.getDate();
		if (Number(day2.getMonth()) + 1 < 10) {
			month = 0 + "" + (day2.getMonth() + 1);
		} else {
			month = (day2.getMonth() + 1);
		}

		if (Number(day2.getDate()) < 10) {
			date = 0 + "" + day2.getDate();
		} else {
			date = day2.getDate();
		}
		var s2 = Number(day2.getFullYear() + "" + month + "" + date);

		<!-- 选择时间-->

		
		var arr = date1.split("-");
		var date2=Number(arr[0]+arr[1]+arr[2]);

		if(date1==null||date1.length<1){
		alert("时间不能为空");
		return false;
		}else if(s2<=date2){
		alert("只能查看往日记录");
		return false;
		}
		ajaxCall("get", "../HistoryServlet?Date=" + date1, show);


	}
	function show(data) {
		var obj = JSON.parse(data);
		var jsonObj = obj;
		var secomment = obj[0].secomment; //作业
		var table = obj[0].table;
		var tecomment = obj[0].tecomment; //结对作业
		var seanw = obj[0].seanw;
		var teanw = obj[0].teanw;
		t = document.getElementById("d1");

		t.innerHTML = table;
		document.getElementById("tarea1").value = seanw;
		document.getElementById("tarea2").value = secomment;
		document.getElementById("tarea3").value = teanw;
		document.getElementById("tarea4").value = tecomment;

	}
</script>
</head>
<body>
	<%
		User user = (User) request.getSession().getAttribute("user");
		String img = (String) user.getImg();
	%>
	<div id="wrapper">
		<nav class="navbar navbar-default navbar-cls-top " role="navigation"
			style="margin-bottom: 0">
			<div class="navbar-header">
				<!--                 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse"> -->
				<!--                     <span class="sr-only">Toggle navigation</span> -->
				<!--                     <span class="icon-bar"></span> -->
				<!--                     <span class="icon-bar"></span> -->
				<!--                     <span class="icon-bar"></span> -->
				<!--                 </button> -->
				<a class="navbar-brand">自在天原</a>
			</div>
			<div
				style="color: white;
padding: 15px 50px 5px 50px;
float: right;
font-size: 16px;">
				<form action="../loginOut.jsp" method="post">
					<button type="submit" class="btn btn-danger">注销</button>
				</form>
			</div>
		</nav>
		<!-- /. NAV TOP  -->
		<nav class="navbar-default navbar-side" role="navigation">
			<div class="sidebar-collapse">
				<ul class="nav" id="main-menu">
					<li class="text-center"><img src="<%=img%>"
						class="user-image img-responsive" /></li>

					<li><a href="../index.jsp"><i
							class="fa fa-dashboard fa-3x"></i> 主页</a></li>
					<li><a href="UserInfo.jsp"><i class="fa fa-table fa-3x"></i>
							个人信息</a></li>
					<li><a href="SelfExam.jsp"><i class="fa fa-desktop fa-3x"></i>
							今日竞赛</a></li>
					<li><a href="TeamExam.jsp"><i class="fa fa-qrcode fa-3x"></i>
							今日结对</a></li>
					<li><a href="History.jsp"><i
							class="fa fa-bar-chart-o fa-3x"></i> 历史记录</a></li>

					<li><a href="ChangePassword.jsp"><i
							class="fa fa-edit fa-3x"></i> 密码修改 </a></li>


				</ul>

			</div>

		</nav>
		<!-- /. NAV SIDE  -->
		<div id="page-wrapper">
			<div id="page-inner">
				<div class="row">
						<div class="col-sm-offset-4 col-sm-8">
		请选择日期：<input type="date" id="targetdate" name="date" /> <input
			type="button" class="btn btn-primary" onclick="refresh()" value="查找" />
	</div>


	<div id="d1"></div>
				</div>
				<!-- /. ROW  -->
				<hr />

			</div>
			<!-- /. PAGE INNER  -->
		</div>
		<!-- /. PAGE WRAPPER  -->
	</div>
	<!-- /. WRAPPER  -->
	<!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
	<!-- JQUERY SCRIPTS -->
	<script src="../js/jquery-1.10.2.js"></script>
	<!-- BOOTSTRAP SCRIPTS -->
	<script src="../js/bootstrap.min.js"></script>
	<!-- METISMENU SCRIPTS -->
	<script src="../js/jquery.metisMenu.js"></script>


		<!-- 模态框（Modal） -->

	<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true"
		data-backdrop="static">
		<div class="modal-dialog">
			<div class="modal-content" style="width: 800px; height: 500px;">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">结对评分</h4>
				</div>
				<div class="modal-body">
					<div style="width: 58%; float: left; padding: 20px 0px">
						学员答案
						<textarea id="tarea1" rows="15" cols="60"
							style="background: transparent" disabled="true"></textarea>
					</div>

					<div style="width: 35%; float: right; padding: 20px 0px">
						评语
						<textarea name="comment" id="tarea2" rows="10" cols="35"
							style="background: transparent"></textarea>

					</div>

					<div id="div1" style="width: 35%; float: right; padding: 15px 0px">
						<br> <br> <br>
					</div>
					<div id="div2" style="display: none;">
						<input id="text1"></input> <input id="text2" name="targetdate"></input>
						<input id="text3" name="stuIds"></input>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭
					</button>

				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>

	<!-- 模态框（Modal） -->

	<div class="modal fade" id="myModal1" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true"
		data-backdrop="static">
		<div class="modal-dialog">
			<div class="modal-content" style="width: 800px; height: 500px;">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">结对评分</h4>
				</div>
				<div class="modal-body">
					<div style="width: 58%; float: left; padding: 20px 0px">
						学员答案
						<textarea id="tarea3" rows="15" cols="60"
							style="background: transparent" disabled="true"></textarea>
					</div>

					<div style="width: 35%; float: right; padding: 20px 0px">
						评语
						<textarea name="comment" id="tarea4" rows="10" cols="35"
							style="background: transparent"></textarea>

					</div>

					<div id="div1" style="width: 35%; float: right; padding: 15px 0px">
						<br> <br> <br>
					</div>
					<div id="div2" style="display: none;">
						<input id="text1"></input> <input id="text2" name="targetdate"></input>
						<input id="text3" name="stuIds"></input>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭
					</button>

				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>

</body>
</html>
